package day017.thread;

public class PriorityDemo {
    public static void main(String[] args) {
        Thread thread1 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 1000; i++) {
                    System.out.println(Thread.currentThread().getName() + ":" + i);
                }
            }
        });
        thread1.setPriority(1);
        thread1.start();

        Thread thread2 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 1000; i++) {
                    System.out.println(Thread.currentThread().getName() + ":" + i);
                }
            }
        });

        thread2.setPriority(10);
        thread2.start();
    }
}
